<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>ref获取dom属性</title>
</head>
<body>
<div id="app">
   <input type="text" ref="refLabel">
   <button @click="getValue">点击查看dom元素</button>
</div>
<script src="https://cdn.jsdelivr.net/npm/vue@2.5.21/dist/vue.min.js"></script>
<script>
    let vm = new Vue({
        el: "#app",
        methods: {
            getValue: function (){
                console.log(this.$refs.refLabel);
                console.log("value是->"+this.$refs.refLabel.value)
            }
        }
    })
</script>
</body>
</html>